﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
namespace F11
{
    class NewDialog : Form
    {
        public Button confirm;
        private TabControl tabControl1;
        public Button cancel;
        private List<Label> TablabelsKind;
        public List<TextBox> TabTextsKind;
        private List<Label> TablabelsPrice;
        public List<TextBox> TabTextsPrice;
        private List<Label> TablabelsAmount;
        public List<TextBox> TabTextsAmount;
        private List<TabPage> tabPages;
        private Button additem;
        private Label orderid;
        private Label orderdata;
        private Label ordermoney;
        public TextBox id;
        public TextBox date;
        public TextBox money;
        public TextBox client;
        private Label orderclient;
        public int count;
        public NewDialog()
        {
            TablabelsKind = new List<Label>();
            TabTextsKind = new List<TextBox>();
            TablabelsPrice = new List<Label>();
            TabTextsPrice = new List<TextBox>();
            TablabelsAmount = new List<Label>();
            TabTextsAmount = new List<TextBox>(); tabPages = new List<TabPage>();
            InitializeComponent();
            addTabLabel();
        }
        private void addTabLabel()
        {
            count++;   
            this.TablabelsKind.Add(new Label());
            this.TablabelsKind[TablabelsKind.Count-1].AutoSize = true;
            this.TablabelsKind[TablabelsKind.Count - 1].Location = new System.Drawing.Point(10, 40);
            this.TablabelsKind[TablabelsKind.Count - 1].Name = "kindlabel";
            this.TablabelsKind[TablabelsKind.Count - 1].Size = new System.Drawing.Size(40, 20);
            this.TablabelsKind[TablabelsKind.Count - 1].TabIndex = count*3-3;
            this.TablabelsKind[TablabelsKind.Count - 1].Text = "种类";
            //3
            this.TablabelsPrice.Add(new Label());
            this.TablabelsPrice[TablabelsPrice.Count-1].AutoSize = true;
            this.TablabelsPrice[TablabelsPrice.Count - 1].Location = new System.Drawing.Point(150, 40);
            this.TablabelsPrice[TablabelsPrice.Count - 1].Name = "pricelabel";
            this.TablabelsPrice[TablabelsPrice.Count - 1].Size = new System.Drawing.Size(40, 20);
            this.TablabelsPrice[TablabelsPrice.Count - 1].TabIndex = count * 3 - 2;
            this.TablabelsPrice[TablabelsPrice.Count - 1].Text = "价格";
            // 
            // label2
            // 
            this.TablabelsAmount.Add(new Label());
            this.TablabelsAmount[TablabelsAmount.Count-1].AutoSize = true;
            this.TablabelsAmount[TablabelsAmount.Count - 1].Location = new System.Drawing.Point(300, 40);
            this.TablabelsAmount[TablabelsAmount.Count - 1].Name = "amountlabel";
            this.TablabelsAmount[TablabelsAmount.Count - 1].Size = new System.Drawing.Size(40, 20);
            this.TablabelsAmount[TablabelsAmount.Count - 1].TabIndex = count * 3 - 1;
            this.TablabelsAmount[TablabelsAmount.Count - 1].Text = "数量";
            // 
            // kindlabel
            // 

            // 
            // textBox7
            // 
            TabTextsAmount.Add(new TextBox());
            this.TabTextsAmount[TabTextsAmount.Count-1].Location = new System.Drawing.Point(390, 40);
            this.TabTextsAmount[TabTextsAmount.Count - 1].Name = "amounttext";
            this.TabTextsAmount[TabTextsAmount.Count - 1].Size = new System.Drawing.Size(50, 30);
            this.TabTextsAmount[TabTextsAmount.Count - 1].TabIndex = count * 3 - 1;
            // 
            // textBox6
            // 
            TabTextsPrice.Add(new TextBox());
            this.TabTextsPrice[TabTextsPrice.Count-1].Location = new System.Drawing.Point(220, 40);
            this.TabTextsPrice[TabTextsPrice.Count - 1].Name = "pricetext";
            this.TabTextsPrice[TabTextsPrice.Count - 1].Size = new System.Drawing.Size(50, 30);
            this.TabTextsPrice[TabTextsPrice.Count - 1].TabIndex = count * 3 - 2;
            // 
            // textBox5
            // 
            TabTextsKind.Add(new TextBox());
            this.TabTextsKind[TabTextsKind.Count - 1].Location = new System.Drawing.Point(80, 40);
            this.TabTextsKind[TabTextsKind.Count - 1].Name = "kindtext";
            this.TabTextsKind[TabTextsKind.Count - 1].Size = new System.Drawing.Size(50, 30);
            this.TabTextsKind[TabTextsKind.Count - 1].TabIndex = count*3-3;

            this.tabPages.Add(new TabPage());
            TabPage page = tabPages[tabPages.Count-1];
            this.tabControl1.Controls.Add(page);
            // 
            // tabPage1
            // 
            page.Controls.Add(this.TablabelsKind[TablabelsKind.Count - 1]);
            page.Controls.Add(this.TablabelsPrice[TablabelsPrice.Count - 1]);
            page.Controls.Add(this.TablabelsAmount[TablabelsAmount.Count - 1]);
            page.Controls.Add(this.TabTextsKind[TabTextsKind.Count - 1]);
            page.Controls.Add(this.TabTextsPrice[TabTextsPrice.Count - 1]);
            page.Controls.Add(this.TabTextsAmount[TabTextsAmount.Count - 1]);
            page.Location = new System.Drawing.Point(4, 29);
            page.Name = "tabPage"+count.ToString();
            page.Padding = new System.Windows.Forms.Padding(3);
            page.Size = new System.Drawing.Size(474, 92);
            page.TabIndex = count;
            page.Text = page.Name;
            page.UseVisualStyleBackColor = true;
        }
        private void InitializeComponent()
        {
            this.confirm = new System.Windows.Forms.Button();
            this.cancel = new System.Windows.Forms.Button();
            this.tabControl1 = new System.Windows.Forms.TabControl();
            this.additem = new System.Windows.Forms.Button();
            this.orderid = new System.Windows.Forms.Label();
            this.orderdata = new System.Windows.Forms.Label();
            this.ordermoney = new System.Windows.Forms.Label();
            this.id = new System.Windows.Forms.TextBox();
            this.date = new System.Windows.Forms.TextBox();
            this.money = new System.Windows.Forms.TextBox();
            this.client = new System.Windows.Forms.TextBox();
            this.orderclient = new System.Windows.Forms.Label();
            this.SuspendLayout();
            // 
            // confirm
            // 
            this.confirm.Location = new System.Drawing.Point(497, 371);
            this.confirm.Name = "confirm";
            this.confirm.Size = new System.Drawing.Size(94, 29);
            this.confirm.TabIndex = 0;
            this.confirm.Text = "确认";
            this.confirm.UseVisualStyleBackColor = true;
            // 
            // cancel
            // 
            this.cancel.Location = new System.Drawing.Point(100, 371);
            this.cancel.Name = "cancel";
            this.cancel.Size = new System.Drawing.Size(94, 29);
            this.cancel.TabIndex = 1;
            this.cancel.Text = "取消";
            this.cancel.UseVisualStyleBackColor = true;
            this.cancel.Click += new System.EventHandler(this.cancel_Click);
            // 
            // tabControl1
            // 
            this.tabControl1.Location = new System.Drawing.Point(125, 39);
            this.tabControl1.Name = "tabControl1";
            this.tabControl1.SelectedIndex = 0;
            this.tabControl1.Size = new System.Drawing.Size(482, 125);
            this.tabControl1.TabIndex = 3;
            // 
            // additem
            // 
            this.additem.Location = new System.Drawing.Point(12, 98);
            this.additem.Name = "additem";
            this.additem.Size = new System.Drawing.Size(94, 29);
            this.additem.TabIndex = 4;
            this.additem.Text = "增加明细";
            this.additem.UseVisualStyleBackColor = true;
            this.additem.Click += new System.EventHandler(this.button3_Click);
            // 
            // orderid
            // 
            this.orderid.AutoSize = true;
            this.orderid.Location = new System.Drawing.Point(261, 181);
            this.orderid.Name = "orderid";
            this.orderid.Size = new System.Drawing.Size(54, 20);
            this.orderid.TabIndex = 6;
            this.orderid.Text = "订单号";
            // 
            // orderdata
            // 
            this.orderdata.AutoSize = true;
            this.orderdata.Location = new System.Drawing.Point(261, 230);
            this.orderdata.Name = "orderdata";
            this.orderdata.Size = new System.Drawing.Size(39, 20);
            this.orderdata.TabIndex = 7;
            this.orderdata.Text = "日期";
            this.orderdata.Click += new System.EventHandler(this.label2_Click);
            // 
            // ordermoney
            // 
            this.ordermoney.AutoSize = true;
            this.ordermoney.Location = new System.Drawing.Point(261, 286);
            this.ordermoney.Name = "ordermoney";
            this.ordermoney.Size = new System.Drawing.Size(39, 20);
            this.ordermoney.TabIndex = 8;
            this.ordermoney.Text = "金额";
            // 
            // id
            // 
            this.id.Location = new System.Drawing.Point(354, 181);
            this.id.Name = "id";
            this.id.Size = new System.Drawing.Size(125, 27);
            this.id.TabIndex = 9;
            // 
            // date
            // 
            this.date.Location = new System.Drawing.Point(354, 230);
            this.date.Name = "date";
            this.date.Size = new System.Drawing.Size(125, 27);
            this.date.TabIndex = 10;
            // 
            // money
            // 
            this.money.Location = new System.Drawing.Point(354, 286);
            this.money.Name = "money";
            this.money.Size = new System.Drawing.Size(125, 27);
            this.money.TabIndex = 11;
            // 
            // client
            // 
            this.client.Location = new System.Drawing.Point(354, 338);
            this.client.Name = "client";
            this.client.Size = new System.Drawing.Size(125, 27);
            this.client.TabIndex = 12;
            // 
            // orderclient
            // 
            this.orderclient.AutoSize = true;
            this.orderclient.Location = new System.Drawing.Point(261, 339);
            this.orderclient.Name = "orderclient";
            this.orderclient.Size = new System.Drawing.Size(39, 20);
            this.orderclient.TabIndex = 13;
            this.orderclient.Text = "客户";
            // 
            // NewDialog
            // 
            this.ClientSize = new System.Drawing.Size(644, 425);
            this.Controls.Add(this.orderclient);
            this.Controls.Add(this.client);
            this.Controls.Add(this.money);
            this.Controls.Add(this.date);
            this.Controls.Add(this.id);
            this.Controls.Add(this.ordermoney);
            this.Controls.Add(this.orderdata);
            this.Controls.Add(this.orderid);
            this.Controls.Add(this.additem);
            this.Controls.Add(this.tabControl1);
            this.Controls.Add(this.cancel);
            this.Controls.Add(this.confirm);
            this.Name = "NewDialog";
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        private void button3_Click(object sender, EventArgs e)
        {
            addTabLabel();
        }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        private void cancel_Click(object sender, EventArgs e)
        {
            
        }
    }
}
